import { reactive } from 'vue';
import axios from 'axios'
export default function (){
    // 数据
    let dogList = reactive([]);
    // 方法
    const getDog = async () => {
        try {
            const res = await axios.get('https://dog.ceo/api/breed/pembroke/images/random')
            dogList.push(res?.data?.message);
        } catch (error) {
            console.log(error)
        }
    }
    // 向外部提供东西
    return {dogList,getDog}
}